//=========================================================================
// lib/string.c (C) Zhao Yanbai
// 	wed, 30 Jul 2008 15:22 +0800
//=========================================================================

#include"string.h"

char *strcpy(char *dest, const char *src)
{
	char *p = dest;
	while((*dest++ = *src++));
	return p;
}

size_t strlen(const char *str)
{
	int i=0;
	while(*str++) i++;
	return i;
}

void *memcpy(void *dest, const void *src, size_t size)
{
	char *d = (char *) dest;
	char *s = (char *) src;
	while(size-->0) {*d = *s;d++;s++;}
	return dest;
}

void	memset(char *dest, char ch, size_t size)
{
	while(size--) *dest++ = ch;
}
